/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#include "BlenderBuilder.h"

namespace GNgine
{
	BlenderBuilder::BlenderBuilder()
		: _inited(false),_sceneObject(0)
	{
	}

	BlenderBuilder::~BlenderBuilder()
	{
		if(_sceneObject){
			GNgEngine.removeSceneObject(_sceneObject);
		}
	}

	BlenderBuilder& BlenderBuilder::getSingleton()
	{
		static BlenderBuilder inst;
		return inst;
	}

	void BlenderBuilder::init(Ogre::String wnd,int width,int height)
	{
		if(_inited){
			return;
		}
		_sceneObject=GNgEngine.createSceneObject(wnd,width,height);
		_sceneObject->getRenderProperty().setBackground(Ogre::ColourValue(0.5,0.5,0.5));
		_inited=true;

	}

	void BlenderBuilder::update(float deltaT)
	{
		GNgEngine.update(_sceneObject,deltaT);
	}

	void BlenderBuilder::ResetScreenResolution(int width,int height)
	{
	}

	void BlenderBuilder::ResetInput()
	{
	}

	void BlenderBuilder::OnKeyDown(Ogre::uint key)
	{
	}
	void BlenderBuilder::OnKeyUp(Ogre::uint key)
	{
	}

	void BlenderBuilder::OnMouseLeftDown(int x,int y)
	{
	}
	void BlenderBuilder::OnMouseLeftUp(int x,int y)
	{
	}

	void BlenderBuilder::OnMouseRightDown(int x,int y)
	{
	}
	void BlenderBuilder::OnMouseRightUp(int x,int y)
	{
	}

	void BlenderBuilder::OnMouseMidDown(int x,int y)
	{
	}
	void BlenderBuilder::OnMouseMidUp(int x,int y)
	{
	}

	void BlenderBuilder::OnMouseMove(int x,int y)
	{
	}
}
